using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Destra.Tools.DACGenerator.Config
{
    [XmlRoot("EntityGeneratorConfig")]
    public class EntityGeneratorConfig : GeneratorConfig
    {

        [XmlAttribute("EntityInterfaces")]
        public string EntityInterfaces;

        [XmlAttribute("CreateValidationClass")]
        public bool CreateValidationClass;

        [XmlAttribute("EntityUsingStatements")]
        public string EntityUsingStatements;

        [XmlAttribute("EntityCustomAttributes")]
        public string EntityCustomAttributes;

        public List<CustomEntityAttribute> CustomAttributes ;

        public EntityGeneratorConfig()
        {CustomAttributes=new List<CustomEntityAttribute>();

        }

        [Serializable()]
        public class CustomEntityAttribute
        {

            public CustomEntityAttribute()
            {
            }

            public CustomEntityAttribute(string propertyName, string propertyAttribute)
            {
                PropertyName = propertyName;
                PropertyAttribute = propertyAttribute;
            }

            private string propertyNameField;

            [XmlElement()]
            public string PropertyName
            {
                get { return propertyNameField; }
                set { propertyNameField = value; }
            }

            private string propertyAttributeField;

            [XmlElement()]
            public string PropertyAttribute
            {
                get { return propertyAttributeField; }
                set { propertyAttributeField = value; }
            }

        }

    }
}
